package demo1;

public class Computer {

    public void powerOn() {
        System.out.println("打开电脑");
    }

    public void poweroff() {
        System.out.println("关闭电脑");
    }

    public void usbDevice(IUSB iusb) {
        iusb.openDevice();
        if (iusb instanceof Mouse) {
            Mouse mouse = (Mouse) iusb;
            mouse.click();
        } else {
            Skyboard skyboard = (Skyboard)iusb;
            skyboard.inPut();
        }
        iusb.closeDevise();
    }
}
